<?php
class Vfriend_Auth extends Zend_Auth {
	var $Auth = null;
	public function __construct() {
		$this->Auth = parent::getInstance();
	}
	/**
	* @intSite: 0 - frontend; 1 - backend
	*/
	public function authVfriend($strEmail,$intSite=0) {		
		if($intSite == 0) {
			$objVfriendUser = new Vfriend_User();
			$objUser = $objVfriendUser->getInfoByEmail($strEmail);
			$this->Auth->setStorage(new Zend_Auth_Storage_Session(SESSION_VFRIEND_AUTH));			
		}
		else {
			$objUser = $strEmail;
			$this->Auth->setStorage(new Zend_Auth_Storage_Session(SESSION_ADMIN_AUTH));
		}
		$this->Auth->getStorage()->write($objUser);
		return $objUser;		
	}
}
?>